package com.dykj.fireFighting.server.socialUnit.buildmanger.service.impl;

import com.dykj.fireFighting.api.socialUnit.buildmanger.entity.Building;
import com.dykj.fireFighting.api.socialUnit.buildmanger.service.IBuildingService;
import com.dykj.fireFighting.api.socialUnit.buildmanger.vo.BuildingVo;
import com.dykj.fireFighting.common.core.service.impl.BaseServiceImpl;
import com.dykj.fireFighting.common.core.vo.TreeVo;
import com.dykj.fireFighting.server.socialUnit.buildmanger.mapper.BuildingMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 建筑管理-楼栋管理
 *
 * @Author aixiaolan
 * @Date 2021-06-22 16:04:02
 */
@Slf4j
@DubboService
@Transactional(rollbackFor = Exception.class)
public class BuildingServiceImpl extends BaseServiceImpl<BuildingMapper, Building> implements IBuildingService {

    @Override
    public List<Building> getBuildList(String unitId) {
        return baseMapper.getBuildList(unitId);

    }

    @Override
    public List<TreeVo> queryBuildFloorPartitionsTree(String enterpriseId) {
        return baseMapper.queryBuildFloorPartitionsTree(enterpriseId);
    }

    @Override
    public BuildingVo queryBuildFloorPartitionsInfo(String buildId, String floorId, String partitionsId) {
        if(StringUtils.isBlank(buildId) && StringUtils.isBlank(floorId) && StringUtils.isBlank(partitionsId)){
            return new BuildingVo();
        }
        return baseMapper.queryBuildFloorPartitionsInfo(buildId,floorId,partitionsId);
    }


}
